public class Java封装 {
    private String name;
    private int age;

    public Java封装() {
        this("liushai",18);
        System.out.println("Java封装无参的构造方法执行！！！！！！");
    }

    public Java封装(String name, int age) {
        System.out.println("Java封装有参的构造方法执行！！！！！！");
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public static void main(String[] args) {
        Java封装 java = new Java封装();
        java.name = "crio23j";//证实了private修饰的成员变量只能再同一个包的同一个类中使用

    }

}
